package tsinghua.smxq.foodprice;


import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

public class TimeFormatTransform 
{
	public static String Blank2Else(String blankInside)
	{		
		return blankInside.replace(" ", "%20");		
	}
	
	public static String Else2Blank(String elseformat)
	{
		return elseformat.replace("%20", " ");
	}
	
	public static String getCurrentDate()
	{
			TimeZone timeZ = TimeZone.getTimeZone("GMT+8");
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
			sdf.setTimeZone(timeZ);
			return Blank2Else(sdf.format(new Date()));   
	}
	
	public static String getCurrentDate_Blank()
	{
			TimeZone timeZ = TimeZone.getTimeZone("GMT+8");
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
			sdf.setTimeZone(timeZ);
			return sdf.format(new Date());   
	}
}

